import request from '@/utils/request_zc'

export function getDistributionManagementList ({
  page,
  limit,
  distributionNo,
  carryApplyNo
}) {
  return request({
    url: '/wms/distribution/list',
    method: 'get',
    params: {
      page,
      limit,
      distributionNo,
      carryApplyNo
    }
  })
}

export function getDistributionManagementDetailList ({ id }) {
  return request({
    url: `/wms/distribution/detail/${id}`,
    method: 'get',
    data: {
      id
    }
  })
}



export function editDistributionManagement ({
  arriveDate,
  customerContact,
  customerName,
  customerPhone,
  deliveryAddress,
  detailList,
  dispatchId,
  distributionAddress,
  distributionDate,
  distributionNo,
  distributionStatus,
  driver,
  driverPhone,
  id,
  licensePlate,
  remark
}) {
  return request({
    url: '/wms/distribution/edit',
    method: 'post',
    data: {
      arriveDate,
      customerContact,
      customerName,
      customerPhone,
      deliveryAddress,
      detailList: detailList || [],
      dispatchId,
      distributionAddress,
      distributionDate,
      distributionNo,
      distributionStatus,
      driver,
      driverPhone,
      id,
      licensePlate,
      remark
    }
  })
}

export function addDistributionManagement ({
  arriveDate,
  customerContact,
  customerName,
  customerPhone,
  deliveryAddress,
  detailList,
  dispatchId,
  distributionAddress,
  distributionDate,
  distributionNo,
  distributionStatus,
  driver,
  driverPhone,
  licensePlate,
  remark
}) {
  return request({
    url: '/wms/distribution/add',
    method: 'post',
    data: {
      arriveDate,
      customerContact,
      customerName,
      customerPhone,
      deliveryAddress,
      detailList: detailList || [],
      dispatchId,
      distributionAddress,
      distributionDate,
      distributionNo,
      distributionStatus,
      driver,
      driverPhone,
      licensePlate,
      remark
    }
  })
}

export function delDistributionManagement ({ ids }) {
  return request({
    url: '/wms/distribution/del',
    method: 'post',
    data: {
      ids
    }
  })
}



